import java.util.Objects;

public class disantian2 {
    public static void main(String[] args) {
        Student s1=new Student("张健一","女",18);
        Student s2 = new Student("王孩龙","男",58);
        System.out.println(s1);
        System.out.println(s2);
        if (Objects.equals(s1,s2)) {
            System.out.println("一样");
        } else {
            System.out.println("不一样");
        }

    }

    static class Student {
        private String name;
        private String sex;
        private int age;

        public Student() {
        }

        public Student(String name, String sex, int age) {
            this.name = name;
            this.sex = sex;
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSex() {
            return sex;
        }

        public void setSex(String sex) {
            this.sex = sex;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        @Override
        public String toString() {
            return "Student{" +
                    "name='" + name + '\'' +
                    ", sex='" + sex + '\'' +
                    ", age=" + age +
                    '}';
        }
    }
    }